#include <cstdio>
#include <cstring>
char s[85];
int main ()
{
    //freopen("in.txt","r",stdin);
    while (gets(s)!=NULL)
    {
        int len=strlen(s);
        if ( len==1 && s[0]== '#')
            break;
        for(int i=0;i<len;i++)
        {
            if (s[i] == '!')
                {printf("%%21");continue;}
            else if (s[i] == ' ')
                {printf("%%20");continue;}
            else if (s[i] == '$')
                {printf("%%24");continue;}
            else if (s[i] == '%')
                {printf("%%25");continue;}
            else if (s[i] == '(')
                {printf("%%28");continue;}
            else if (s[i] == ')')
                {printf("%%29");continue;}
            else if (s[i] == '*')
                {printf("%%2a");continue;}
            printf("%c",s[i]);
        }
        printf("\n");
    }
    return 0;
}
